//package ui;
//
//import android.app.Activity;
//import android.content.Intent;
//import android.content.SharedPreferences;
//import android.os.Bundle;
//import android.util.DisplayMetrics;
//import android.view.View;
//import android.view.animation.AlphaAnimation;
//import android.view.animation.Animation;
//
//import cn.aramark.ormsm.IndexActivity;
//import cn.aramark.ormsm.R;
//import config.
//
//
// AppActivity;
//import tools.AppManager;
//
///**
// * Created by TJ on 2016/room_detail/12.
// */
//public class classWelcome extends AppActivity {
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        final View view = View.inflate(this, R.layout.welcome_page, null);
//        setContentView(view);
//        DisplayMetrics dm = new DisplayMetrics();
//        getWindowManager().getDefaultDisplay().getMetrics(dm);
//        double diagonalPixels = Math.sqrt(Math.pow(dm.widthPixels, 2) + Math.pow(dm.heightPixels, 2));
//        double screenSize = diagonalPixels / (160*dm.density);
//        appContext.saveScreenSize(screenSize);
//        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
//        aa.setDuration(2000);
//        view.startAnimation(aa);
//        aa.setAnimationListener(new Animation.AnimationListener() {
//            public void onAnimationEnd(Animation animation) {
//
//                redirectTo();
//            }
//
//            public void onAnimationRepeat(Animation animation) {
//
//            }
//
//            public void onAnimationStart(Animation animation) {
//
//            }
//        });
//    }
//
//    private void redirectTo() {
//        try {
//            SharedPreferences sp = getSharedPreferences("userData", Activity.MODE_PRIVATE);
//            if (!"room_detail".equals(sp.getString("user.login", ""))) {
//                Intent intent = new Intent(this, Login.class);
//                //Intent intent = new Intent(this, TaskListActivity.class);
//                startActivity(intent);
//                AppManager.getAppManager().finishActivity(this);
//            } else {
//                appContext.checkCacheKey = true;//已登录的每次重启APP都需校验CacheKey有效性
//                Intent intent = new Intent(this, IndexActivity.class);
//                startActivity(intent);
//                AppManager.getAppManager().finishActivity(this);
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//}
